package com.swpu.project.strategy.searchimpl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.swpu.project.model.entity.User;
import com.swpu.project.strategy.FilterContext;
import com.swpu.project.strategy.SearchFilter;

import java.util.Map;

public class FilterContextForUser  implements FilterContext<User> {
    Map<String, SearchFilter> foFilterMap;



    @Override
    public LambdaQueryWrapper<User> makeFilterCondtion(LambdaQueryWrapper<User> lambdaQueryWrapper, Map<String, String> filterCondtions) {
        return null;
    }



class NameFilter implements SearchFilter<User>
{

    @Override
    public void doFilter(LambdaQueryWrapper<User> lambdaQueryWrapper, String value) {
        lambdaQueryWrapper.like(User::getUserName,value);
    }
}


class SexFilter implements SearchFilter<User>
{

    @Override
    public void doFilter(LambdaQueryWrapper<User> lambdaQueryWrapper, String value) {
        lambdaQueryWrapper.like(User::getSex,value);

    }
}




}
